package zxs.sino.elite.hub.enums.article;

import zxs.sino.elite.hub.enums.BaseEnum;

/**
 * 文章类型
 *
 * @author zhang
 */
public enum BlogType implements BaseEnum<Integer> {

    ORIGINAL(1, "原创"),
    CROSSPOST(2, "转载"),
    TRANSLATE(3, "翻译");

    private final int code;

    private final String value;

    BlogType(int code, String value) {
        this.code = code;
        this.value = value;
    }

    @Override
    public Integer getCode() {
        return code;
    }

    @Override
    public String getValue() {
        return value;
    }

    public static boolean isOriginal(Integer code) {
        return BaseEnum.isType(BlogType.class, code, ORIGINAL);
    }

    public static boolean isCrosspost(Integer code) {
        return BaseEnum.isType(BlogType.class, code, CROSSPOST);
    }

    public static boolean isTranslate(Integer code) {
        return BaseEnum.isType(BlogType.class, code, TRANSLATE);
    }
}
